package com.ruoqing.core.fallback.fuse;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.ruoqing.core.constant.Constants;
import com.ruoqing.core.domain.rquser.UserEntity;
import com.ruoqing.core.dto.BaseResponse;
import com.ruoqing.core.dto.user.UserResponse;

import java.util.ArrayList;

/**
	* @author YaoXian
	* @title: UserLimitingMethods
	* @projectName ruoxi-blog
	* @description: 若兮微服务 - 用户服务 - 服务限流本地方法
	* @date 2020-11-22 22:27
	*/
public class UserLimitingMethods {
		public static BaseResponse baseLimitingMethod(BlockException e){
				e.printStackTrace();
				return BaseResponse.buildResponse(Constants.responseError,"请求次数过多,触发服务限流策略,请稍后重试!");
		}
		
		public static UserResponse adminLimitingMethod(BlockException e){
				e.printStackTrace();
				return UserResponse.buildUserResponse(Constants.responseError,"请求次数过多,触发服务限流策略,请稍后重试!",new UserEntity()
				,new ArrayList<UserEntity>());
		}
}
